package com.leyou.controller;

import com.leyou.mapper.UserMapper;
import com.leyou.pojo.User;
import com.tgy.autoconfiger.service.CustomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private CustomService customService;



    @GetMapping("/{id}")
    public User findUser(@PathVariable("id") Integer id){

        User user = userMapper.findUserById(id);
        return user;
    }

    @GetMapping("/custom")
    public String testCustom(){

        return customService.run();
    }




}
